import 'api_user_info_login.dart';

/// Android原生"我的"页面头部信息模型
/// 
/// 对应Android的ApiUserInfoMyHead类
/// API路径: /api/user/getMyHeadInfo
/// 
/// 包含用户基本信息和统计数据（粉丝数、关注数、互关数、打赏数等）
class ApiUserInfoMyHead {
  /// 用户基本信息
  final ApiUserInfo userInfo;
  
  /// 粉丝数量
  final int fansNum;
  
  /// 关注数量
  final int followNum;
  
  /// 互关数量
  final int mutualFollowNum;
  
  /// 打赏我的数量
  final int giveMeRewardNum;
  
  /// 点赞数量
  final int likeNum;
  
  /// 收藏数量
  final int collectNum;
  
  /// 看过我的人数
  final int readMeUsersNumber;
  
  /// 主播审核状态
  final int anchorAuditStatus;
  
  /// 主播审核原因
  final String? anchorAuditReason;
  
  /// SVIP剩余天数
  final int svipExpireDay;
  
  /// 贵族剩余天数
  final int nobleExpireDay;
  
  /// 谁看过我是否需要贵族 (0:需要 1:不需要)
  final int isVipSee;
  
  /// 电视剧总数量
  final int televisionNum;
  
  ApiUserInfoMyHead({
    required this.userInfo,
    this.fansNum = 0,
    this.followNum = 0,
    this.mutualFollowNum = 0,
    this.giveMeRewardNum = 0,
    this.likeNum = 0,
    this.collectNum = 0,
    this.readMeUsersNumber = 0,
    this.anchorAuditStatus = 0,
    this.anchorAuditReason,
    this.svipExpireDay = 0,
    this.nobleExpireDay = 0,
    this.isVipSee = 0,
    this.televisionNum = 0,
  });
  
  factory ApiUserInfoMyHead.fromJson(Map<String, dynamic> json) {
    return ApiUserInfoMyHead(
      userInfo: ApiUserInfo.fromJson(
        json['userInfo'] as Map<String, dynamic>? ?? {}
      ),
      fansNum: (json['fansNum'] as num?)?.toInt() ?? 0,
      followNum: (json['followNum'] as num?)?.toInt() ?? 0,
      mutualFollowNum: (json['mutualFollowNum'] as num?)?.toInt() ?? 0,
      giveMeRewardNum: (json['giveMeRewardNum'] as num?)?.toInt() ?? 0,
      likeNum: (json['likeNum'] as num?)?.toInt() ?? 0,
      collectNum: (json['collectNum'] as num?)?.toInt() ?? 0,
      readMeUsersNumber: (json['readMeUsersNumber'] as num?)?.toInt() ?? 0,
      anchorAuditStatus: (json['anchorAuditStatus'] as num?)?.toInt() ?? 0,
      anchorAuditReason: json['anchorAuditReason'] as String?,
      svipExpireDay: (json['svipExpireDay'] as num?)?.toInt() ?? 0,
      nobleExpireDay: (json['nobleExpireDay'] as num?)?.toInt() ?? 0,
      isVipSee: (json['isVipSee'] as num?)?.toInt() ?? 0,
      televisionNum: (json['televisionNum'] as num?)?.toInt() ?? 0,
    );
  }
  
  Map<String, dynamic> toJson() {
    return {
      'userInfo': userInfo.toJson(),
      'fansNum': fansNum,
      'followNum': followNum,
      'mutualFollowNum': mutualFollowNum,
      'giveMeRewardNum': giveMeRewardNum,
      'likeNum': likeNum,
      'collectNum': collectNum,
      'readMeUsersNumber': readMeUsersNumber,
      'anchorAuditStatus': anchorAuditStatus,
      'anchorAuditReason': anchorAuditReason,
      'svipExpireDay': svipExpireDay,
      'nobleExpireDay': nobleExpireDay,
      'isVipSee': isVipSee,
      'televisionNum': televisionNum,
    };
  }
}

